<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head th:replace="admin/_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <!--适应移动端-->
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>Types管理</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
    <link rel="stylesheet" href="../../static/css/me.css">
</head>
<body>
<!--导航-->
<nav th:replace="admin/_fragments :: menu(2)" class="ui inverted attached segment m-padded-tb-mini fly m-shadow-small m-opacity-tiny">
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <h2 class="ui teal header item">后台Management</h2>
            <a href="#" class="item m-mobile-hide m-item"><i class="home icon"></i>博客</a>
            <a href="#" class="item m-mobile-hide m-item"><i class="idea icon"></i>分类</a>
            <a href="#" class="item m-mobile-hide m-item"><i class="tags icon"></i>标签</a>

            <!--头像-->
            <div class="right m-item m-mobile-hide menu">
                <div class="ui dropdown item">
                    <div class="text"><img class="ui avatar image" src="../../static/img/1.png"> RYX</div>
                    <!--下拉框-->
                    <i class="dropdown icon"></i>
                    <div class="menu">
                        <a href="#" class="item">注销</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <a href="#" class="ui menu toggle  black icon button m-top-right m-mobile-show">
        <i class="sidebar icon"></i>
    </a>

</nav>

<!--二级导航-->
    <div class="ui attached menu">
        <div class="ui container">
            <div class="right menu">
                <a href="#" th:href="@{/admin/types/input}" class="item">新增</a>
                <a href="#" th:href="@{/admin/types}" class="active teal item">列表</a>
            </div>

        </div>

    </div>




<!--中间内容部分-->
<div class="m-container-small m-padded-tb-large">
    <div class="ui container">
<!--        header-->
        <div class="ui success message" th:unless="${#strings.isEmpty(message)}">
            <i class="close icon"></i>
            <div class="header">Tip</div>
            <p th:text="${message}">操作成功</p>
        </div>

        <table class="ui celled center aligned table">
            <thead>
                <tr>
                    <th></th>
                    <th>名称</th>
                    <th>操作</th>
                </tr>
            </thead>

            <tbody>
                <tr th:each="type,iterStat : ${page.content}">
                    <td th:text="${iterStat.count}">1</td>
                    <td th:text="${type.name}">what's that?</td>
                    <td>
                        <a href="#" th:href="@{/admin/types/{id}/input(id=${type.id})}" class="ui mini green basic button">编辑</a>
                        <a href="#" th:href="@{/admin/types/{id}/delete(id=${type.id})}" class="ui mini red basic button">删除</a>
                    </td>
                </tr>

            </tbody>

            <tfoot>
                <tr>
                    <th colspan="6" >
                        <div class="ui right floated pagination mini menu" th:if="${page.totalPages}>1">
                            <a th:href="@{/admin/types(page=${page.number}-1)}" class="icon item" th:unless="${page.first}">
                                <i class="left chevron icon"></i>
                            </a>
<!--                            <a class="item">1</a>-->
<!--                            <a class="item">2</a>-->
<!--                            <a class="item">3</a>-->
<!--                            <a class="item">4</a>-->
                            <a th:href="@{/admin/types(page=${page.number}+1)}" class="icon item" th:unless="${page.last}">
                                <i class="right chevron icon"></i>
                            </a>
                        </div>

                        <a href="#" th:href="@{/admin/types/input}" class="ui teal basic button left floated">新增</a>
                    </th>
                </tr>
            </tfoot>

        </table>

    </div>


</div>


<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<!--底部-->
<footer th:replace="admin/_fragments :: footer" class="ui inverted segment vertical m-padded-tb-massive">
    <div class="ui container center aligned">
        <div class="ui  inverted stackable divided grid">
            <div class="three wide column">
                <img src="../../static/img/Qr.jpg" class="ui rounded image" style="width: 110px;">
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header">最新blog</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item ">My story </a>
                    <a href="#" class="item ">My story </a>
                    <a href="#" class="item ">My story </a>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header">最新blog</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item ">My story </a>
                    <a href="#" class="item ">My story </a>
                    <a href="#" class="item ">My story </a>
                </div>
            </div>
            <div class="seven wide column">
                <h4 class="ui inverted header">最新blog</h4>
                <p class="m-text-spaced m-opacity-mini">只要学不死，就往死里学，加油，噢利给！！！</p>
            </div>

        </div>
        <div class="ui inverted section divider"></div>
        <p class="m-text-thin m-text-spaced m-opacity-mini ">Copyright@2020-2021 Swim's Blog Designed by RYX</p>

    </div>
</footer>


<th:block th:replace="admin/_fragments :: script">
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
</th:block>


<script>



    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide');
    });

    $('.ui.dropdown').dropdown({
        on: 'hover'
    });

    $('.message .close')
        .on('click',function () {
            $(this)
                .closest('.message')
                .transition('fade');
        });


</script>

</body>
<script>

</script>
</html>